package com.example.leonard.core.mq.consumer;

import com.example.leonard.core.mq.mqconfig.MQConstants;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class DirectConsumer {
    @RabbitListener(queues = MQConstants.DIRECTQUEUE)
    @RabbitHandler
    public void listenerMessage(String message) {
        System.out.println("队列为queue接收的消息为:" + message);
    }

    @RabbitListener(queues = MQConstants.DIRECTQUEUES)
    @RabbitHandler
    public void listenerMessages(String message) {
        System.out.println("队列为queues接收的消息为:" + message);
    }
}
